<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => 'Giving up for now',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/08/13.jpg" alt="A local bus stop I bike past on my way to work" class="framed-centred-image" width="649" height="480"/>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		I dreamed I was at work, taking someone&apos;s order at their car in the front parking lot.
		I don&apos;t know why I&apos;d do that, we don&apos;t do things that way.
		Anyway, they tried to give me a counterfeit fifty dollar bill.
		It was blue, and felt like it was printed on regular printer paper.
		It was an obvious fake.
		Astounded that they&apos;d try to pass off such an obvious fake on me, I held it up to the light as I&apos;d do a real fifty to check for the special anti-counterfeit strips on the inside.
		Instead, I saw printed maths problems.
		The paper had been repurposed, but was originally been intended to be some child&apos;s maths homework.
		I looked at the back, and the maths problems were barely visible.
		They didn&apos;t look printed; I&apos;m not sure what they were.
		Otherwise, the back of the bill was blank though.
	</p>
	<p>
		I handed it back and told the person it was counterfeit.
		They suddenly got all serious and took on a threatening tone.
		I was afraid, but I also wasn&apos;t taking their bogus money.
		They handed me two real twenties and a I think about six real ones.
		I was seriously confused, as their order was under twenty dollars.
		They could&apos;ve just handed me one twenty.
		I figured I&apos;d bring them back the rest as change once I made their food though, as I wanted to get out of there as quickly as possible.
		At one point, they&apos;d even mentioned kicking in the back door of the store out of anger after dealing with someone else at the drive-through menu board, but they ran into someone with a lighter, got scared, and left.
		I pictured the head manager, just inside the back door, lighting up a cigarette.
		If they&apos;re kicking in the back door though, they&apos;re not someone I want to mess with.
	</p>
	<p>
		Once inside, I couldn&apos;t find the menu items they&apos;d requested.
		I woke up before I could get their order put together.
	</p>
</section>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		I woke up this morning feeling better than last night.
		I was really tired last night and didn&apos;t want to work on coursework.
		As I started getting ready to work on what I should have finished before going to bed last night though, I remembered that&apos;d I&apos;d actually already done it.
		I hadn&apos;t wanted to, but I&apos;d finished up before going to bed.
		Nice!
		Today would be easy then.
		I&apos;d just work on the next part of my work instead of having to try to catch back up.
	</p>
	<p>
		My discussion posts for the day:
	</p>
	<blockquote>
		<p>
			Yes.
			I think we should die out.
			I don&apos;t think we should end our individual lives prematurely, just to be clear.
			We should try to enjoy our lives to the fullest extent we ethically can, which for most people involves living to about their live expectancy.
			But I also don&apos;t think we should be creating new people.
			I think we should stop breeding, which will lead to the end of our species.
		</p>
		<p>
			I have a multitude of reasons I don&apos;t want children.
			One of them is the carbon footprint issue you mentioned.
			I go to great lengths to cut my carbon footprint.
			I don&apos;t drive a motor vehicle, for example.
			I bike everywhere instead.
			I&apos;ve also drastically changed my diet to be much more eco-friendly.
			I&apos;m totally with you as far as not having children to reduce carbon emissions.
			It&apos;s one of my longest-held reasons for my not wanting to breed.
		</p>
		<p>
			I&apos;m not against raising a child though, as long as I don&apos;t create it.
			If I find a nice man I want to spend my life with and he wants to raise a child with me, I&apos;d be cool with adoption.
		</p>
	</blockquote>
	<blockquote>
		<p>
			You make a very good point about the difficulties Thomas Jefferson and company went through.
			To this day, there&apos;s always been people making the tough decisions and standing up against tyrants, despite the risks and outright costs.
			Edward Snowden would be a good modern-day example.
			It&apos;s kind of funny how the United States used to be the good guy, but has taken a turn for the worst.
			It&apos;s not even just the government, but our people as well.
			We&apos;d <strong>*have*</strong> to be pretty bad to vote in our current president!
		</p>
		<p>
			Most of us don&apos;t end up making such important and dangerous decisions though.
			On the whole, our lives are pretty uneventful.
			We work for a living, but like you said, we don&apos;t even build our own homes or the tools we use every day.
		</p>
		<p>
			A healthy dose of socialism, such as having a single-payer healthcare system, would improve the country.
			It&apos;s easy to go to far though.
			End up with too much socialism and people won&apos;t want to work any more.
			They&apos;ll have no reason to.
			With what you earn via working split up amongst everyone, everyone (yourself included) gets less than a cent.
			So why work?
			Of course, everybody feels that way and stops working.
			It adds up, and the country becomes dysfunctional.
			Then again though, our country&apos;s been pretty bad for a while now.
			It might be good if we fell apart.
			Maybe we&apos;d become so weak as a country that some sane country would take us over.
			That&apos;s probably just a dream though.
			No sane and well-off country would want us.
			We&apos;ve got to band together as a people and actually fix our country ourselves.
		</p>
		<p>
			I agree that Plato seems like a buffoon, but I don&apos;t think he needs to be compared to Aristotle to look that way.
			Plato was pretty ... warped.
			His idea of a &quot;perfect&quot; society really shows how twisted he was.
			I did find his allegory of the cave to be pretty insightful though.
			It&apos;s incredibly accurate in describing several major changes I&apos;ve gone through in terms of enlightenment.
			When you come to realise something new and important, it hits you like a tonne of bricks.
			As you begin to adapt to the newfound view of reality, it becomes more mundane, until eventually, you don&apos;t understand why it wasn&apos;t always so obvious to you.
			But others don&apos;t listen.
			Until they come to the same realisation themselves (which usually doesn&apos;t seem to happen because most people don&apos;t seem to contemplate the same things as you), they simply refuse to even try to understand.
			They think you&apos;re wrong and they think you&apos;re crazy.
			Depending on how important the revelation is, you&apos;ve got to cut your losses and accept that other people will continue to live in ignorance.
			That said, even with your revelation, you&apos;re ignorant of other things that other people have come to understand.
			Each and every one of us is unable to comprehend the full picture.
		</p>
		<p>
			You make an excellent point about how those who remember us will die and take their memories with them.
			I&apos;ve explained this countless times to people that think building a legacy is somehow important.
			No one will remember them.
			Seriously.
			We&apos;re all going to die, taking our memories with us.
			People think building memories will matter after they&apos;re dead, but it won&apos;t.
			If you want to build memories because it&apos;ll make you happier while you&apos;re still alive, I say go for it.
			Or maybe you want to help someone else build memories for while they&apos;re alive.
			But don&apos;t even bother if your point is to try to leave an impact.
			You can&apos;t do it.
			You can change the world with your ideas or inventions, but you can&apos;t make people remember who you actually were as a person for generations to come.
			Also, like you said, why try to impress people that don&apos;t care with fancy possessions?
			They don&apos;t care.
			They won&apos;t be impressed.
			And if they were impressed, why would you care that they were impressed?
		</p>
	</blockquote>
</section>
<section id="Minetest">
	<h2>Minetest</h2>
	<img src="/img/CC_BY-SA_3.0/minetest.net./weblog/2018/08/13.png" alt="Levelling the bottom" class="framed-centred-image" width="800" height="600"/>
	<p>
		I took a break from the main problem at hand, fixing <code>minestats</code> back into something usable, and built what I think will &quot;solve&quot; my item description problem.
		Of course, with <code>minestats</code> currently out of commission, the entire game is out of commission, so I can&apos;t test my code.
		If I&apos;m right though, it should add the appropriate <code>description</code> data whenever an item designed with the mod in mind enters any inventory in the normal way.
		Moving items in an inventory, moving items between inventories, and using a mod that just puts an item in a specific inventory slot will not trigger the metadata update though.
		Anyway, putting an item into inventory comes after <code>minestats</code> has worked its magic, so it shouldn&apos;t interfere with <code>minestats</code>.
		Additionally, a known problem with trying to do things after <code>minestats</code> is done has been that items dropped into the world instead of being deposited into a player&apos;s inventory would leave broken items in the world, but this method fixes items as they enter the inventory.
		Broken items will still end up in the world, but it won&apos;t be noticed because they&apos;ll end up fixed as soon as players pick them up.
		I think.
		Again, I need to repair <code>minestats</code> before I can do any real testing, but I also need a mod to test on.
		I&apos;ll need to start work on my mineral or tree mod.
		And to do that, I&apos;ll need to get the base game worked out first.
		I&apos;ll take some time before I can test this code.
	</p>
	<p>
		Speaking of <code>minestats</code>, I&apos;ve come to the realisation that Minetest isn&apos;t matching substrings against tool names.
		After all, Lua doesn&apos;t do substring matching.
		I found out today there&apos;s a way to tell Lua to do substring matching, but it still doesn&apos;t do that by default, and Minetest is still using the most basic call to <code>string.match()</code>, which matches patterns.
		That means the drop predictor in <code>minestats</code> needs to match patterns against patterns in some cases, not strings against strings.
		I&apos;m not even sure there&apos;s a feasible way to do this.
		I have a lead though.
		It&apos;s difficult to understand, but some <a href="https://stackoverflow.com/questions/3410256/regex-determine-if-two-regular-expressions-could-match-for-the-same-input">pattern intersection information</a> is available on Stack Overflow.
	</p>
	<p>
		I asked on three different channels for advice.
		People on the Minetest channel understood the problem, but didn&apos;t know how to even begin solving it.
		People on the Lua channel seemed to believe it to be a solvable problem, but with it being so complex, they didn&apos;t have any ideas either.
		People on the $a[regexp] channel wouldn&apos;t actually read what I was writing, kept claiming to understand the problem, then asking for information that I couldn&apos;t possibly have without changing entirely the nature of the problem and thus solving for the wrong thing.
		In particular, one person kept insisting that the solution was to get the list of patterns and solve by hand, then hard-code the solution into the code and have it ignore the regular expressions altogether.
		I kept trying to explain that there wasn&apos;t a way to know the patterns until run time, so they wanted me to run the program, have it save a list of patterns, then jump back into the development stage and hard-code based on those patterns.
		I explained that my code needs to run not just on my machines, but the machines of others, and that I can&apos;t account for all patterns an instance of the game might encounter if I&apos;m hard-coding based on a select few patterns, but they wouldn&apos;t hear it.
		Eventually, I had to go to work, and when I got back, they&apos;d been chatting with someone else about the issue and it was clear they had no idea what the actual problem was at all.
		They thought I needed a list of tools that yield a particular drop, despite me having already explained that wasn&apos;t the case.
	</p>
	<p>
		I&apos;ve come up with a new plan of action though.
		I can boil the problem down to a bit simpler than it is by using more execution branches in the recursive function that handles all this.
		It&apos;ll actually boil the problem down to the version of the problem I had been explaining to people.
		I was actually omitting some complicating details thinking I could solve for them later, but with this extra branching, the problem will be exactly as I&apos;d explained it to be.
		From there, I&apos;ll handle a few very simple cases, and pass the complex cases to a dummy function for verification of unknown cases.
		The dummy function will claim all cases are valid, but it&apos;ll give me a smaller issue to tackle.
		This function will represent the bulk of what I don&apos;t know how to do at the moment.
		I won&apos;t have to try to work what I don&apos;t know into what I do know without breaking things.
		I think I might stop there until I have a better idea of how to accomplish the task at hand, too.
		With the code back in working order, I&apos;ll be able to put it down again and work on something actually manageable.
		It&apos;s too bad I dont&apos; seem to be able to actually solve the problem just yet though.
	</p>
</section>
END
);
